#include "SemanticNodeBlockLeaveGroup.h"

/**
 *  @fn	SemanticNodeBlockLeaveGroup::SemanticNodeBlockLeaveGroup(const SyntaxTreeNode *leaveGroupNo
 *  	deParent, SemanticNode *parent)
 * 
 *  @brief	Constructor. 
 * 
 *  @author	Nikola Novak
 *  @date	6/26/2009
 * 
 *  @param	leaveGroupNodeParent	If non-null, the leave group node parent.
 *  @param	parent					If non-null, the parent.
 */
SemanticNodeBlockLeaveGroup::SemanticNodeBlockLeaveGroup(const SyntaxTreeNode *leaveGroupNodeParent, SemanticNode *parent) : SemanticNode(parent), LabeledNode(leaveGroupNodeParent->Nodes->GetData(0)) {
	groupExpression = NULL;
}
/**
 *  @fn	void SemanticNodeBlockLeaveGroup::setGroup(SemanticNodeExpression *group)
 * 
 *  @brief	Sets a group. 
 * 
 *  @author	Nikola Novak
 *  @date	6/26/2009
 * 
 *  @param	group	If non-null, the group.
 */
void SemanticNodeBlockLeaveGroup::setGroup(SemanticNodeExpression *group) {
	groupExpression = group;
}

/**
 *  @fn	std::string SemanticNodeBlockLeaveGroup::toDebugString(int tab)
 * 
 *  @brief	Converts a tab to a debug string. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	tab	The tab.
 * 
 *  @return	This object as a std::string.
 */
std::string SemanticNodeBlockLeaveGroup::toDebugString(int tab) {
	std::ostringstream res;
	res << getLabelsDebugString() << ": leave group" << std::endl << ((SemanticNode *)groupExpression)->toDebugString(tab + 1);
	return res.str();
}
